from tortoise import BaseDBAsyncClient

RUN_IN_TRANSACTION = True


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `rag_db` ADD `chunks` LONGTEXT NOT NULL COMMENT '知识库文本信息';
        ALTER TABLE `rag_db` ADD `rag_path` VARCHAR(200) NOT NULL COMMENT '向量数据库地址';"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `rag_db` DROP COLUMN `chunks`;
        ALTER TABLE `rag_db` DROP COLUMN `rag_path`;"""


MODELS_STATE = (
    "eJztlm1vmzAQx79KxatO6iYgPKR7l0V7VJdIaTZVaipkwDwoYCiYLVGV7z6fCTUhgRBpU1"
    "ppb1Dyvztz9+Ps85MUJy6O8ncz5FuuLb2/eJIIijH70bBcXUgoTYUOAkV2xF0z4WPnNEMO"
    "ZaqHohwzycW5k4UpDRPCVFJEEYiJwxxD4gupIOFjgS2a+JgGOGOG+wcmh8TFK5xXf9Ol5Y"
    "U4cndSDV14N9ctuk659pXQT9wR3mZbThIVMRHO6ZoGCXn2DgkF1ccEZ4hiWJ5mBaQP2W3r"
    "rCoqMxUuZYq1GBd7qIhordyeDJyEAD+WTc4L9OEtb1VFM7XhwNCGzIVn8qyYm7I8UXsZyA"
    "lM5tKG2xFFpQfHKLjBd+O/9+iNA5QdxlePaUBkqTchVsj+AUVpUeiaoiyKa8XxFoWhmzJ7"
    "DgzMdHw9AKtcpn+cc4xWVoSJTwP2V1GHHVR/jmbjL6PZJfN6A6snrN3LXTDZmtTSBugF6n"
    "rue7TneNXSrI2wvwO8EgRxsVePITcGAHvoeXI/tB0k5x/v5rBInOePUR3g5ffRHWcbr7eW"
    "m+nkc+VeAz6+mX5ocIb2TBH7jie2dBVzfsJHmtocyPDUevLfbW1Vlnu0NvNqbW1u20XuBA"
    "VZ5qd0tYg4P27TxDpraNsxKsSGPjTZ01SdRaF5mH0MQza8l9PuMAa9Ze1AB8FGzvI3ylxr"
    "z5KoSZvvvilW46aCCPI5U6gY6tteDEY4C53g0JVha+m8MiDh8//K8IquDL9wlh+cYe3Hay"
    "3kzNu9P8XdU1PX+5yaut5+aoJt99SErXECxK376wSo9Bo7SsfYUQ6MnYRQXO7BXYjfbqeT"
    "lrkjQhogfxBW4L0bOvTqIgpz+vAysXZQhKq7x0tzkgCFJKd+xlfhC5x9vGz+AHnynX8="
)
